package com.codefish.example.event.listener;

import com.codefish.example.event.SayHelloApplicationEvent;
import com.codefish.framework.spring.context.event.IApplicationListener;

/**
 * @author <a href='https://gitee.com/hzf2281'>codefish</a>
 * @version 1.0.0
 * @since 2022/10/10 下午 03:57
 */
public class HelloMessageEventListener implements IApplicationListener<SayHelloApplicationEvent> {

    private  String name;

    public HelloMessageEventListener(){

    }

    public HelloMessageEventListener(String name) {
        this.name = name;
    }

    @Override
    public void onApplicationEvent(SayHelloApplicationEvent applicationEvent) {
        System.out.println("[" + this.name + "]收到消息：" + applicationEvent.getMessage());
    }
}
